]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search-display: Enable swipe scrolling
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 21 Jan 2011 22:49:03 +0000 (23:49 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 24 Jan 2011 01:59:46 +0000 (02:59 +0100)
If a search gives many results from various providers, the result
area will be scrollable, so enable swipe-scrolling here as well.

https://bugzilla.gnome.org/show_bug.cgi?id=635034

js/ui/searchDisplay.js

index f85eb6714a3d3e340cab460d1eb12b562501bce3..45fccd6ea5addd1574c83953dd97d09eeed1a680 100644 (file)
@@ -10,6 +10,7 @@ const St = imports.gi.St;
 const DND = imports.ui.dnd;
 const IconGrid = imports.ui.iconGrid;
 const Main = imports.ui.main;
+const Overview = imports.ui.overview;
 const Search = imports.ui.search;
 
 const MAX_SEARCH_RESULTS_ROWS = 2;
@@ -175,6 +176,15 @@ SearchResults.prototype = {
                                      expand: true,
                                      x_align: St.Align.START,
                                      y_align: St.Align.START });
+        this.actor.connect('notify::mapped', Lang.bind(this,
+            function() {
+                if (!this.actor.mapped)
+                    return;
+
+                let adjustment = scrollView.vscroll.adjustment;
+                let direction = Overview.SwipeScrollDirection.VERTICAL;
+                Main.overview.setScrollAdjustment(adjustment, direction);
+            }));
 
         this._statusText = new St.Label({ style_class: 'search-statustext' });
         this._content.add(this._statusText);